package com.work.vo.main;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.work.constant.DictBizConstant;
import com.work.entity.main.TShipBill;
import com.work.utils.BigDecimalSerializer;
import com.work.vo.transport.TransportBillVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 单垛理货VO
 *
 * @author ：dujianyu
 * @since ：Created in 2024/3/20 10:01
 */
@Data
public class OneStockTallyVO {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "id")
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "理货舱单ID")
    private Long tShipBillId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "id")
    private Long transportBillId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "id")
    private Long transportShipId;

    @ApiModelProperty(value = "船名")
    private String shipNameZh;

    @ApiModelProperty(value = "货名")
    private String cargoType;

    @ApiModelProperty(value = "货名")
    private String cargoTypeName;

    @ApiModelProperty(value = "航次")
    private String voyage;

    @ApiModelProperty(value = "进出口")
    private String iE;

    @ApiModelProperty(value = "舱单号")
    private String billNo;

    @ApiModelProperty(value = "理货日期")
    private LocalDate tallyDate;

    @ApiModelProperty(value = "时间段")
    private String timeSpace;

    @ApiModelProperty(value = "时间段")
    private String timeSpaceName;

    public String getTimeSpaceName() {
        if (Func.isNull(timeSpace)) {
            return "";
        }
        return DictBizCache.getValue(DictBizConstant.TIME_SPACE, timeSpace);
    }

    @ApiModelProperty(value = "理货类型")
    private String tallyType;

    @ApiModelProperty(value = "理货类型")
    private String tallyTypeName;

    public String getTallyTypeName() {
        if (Func.isNull(tallyType)) {
            return "";
        }
        return DictBizCache.getValue(DictBizConstant.TALLY_TYPE, tallyType);
    }

    @ApiModelProperty(value = "理货包装")
    private String tallyPackageType;

    @ApiModelProperty(value = "理货包装")
    private String tallyPackageTypeName;

    @ApiModelProperty(value = "理货件数")
    private Integer tallyPiece;

    @JsonSerialize(using = BigDecimalSerializer.class)
    @ApiModelProperty(value = "理货吨数")
    private BigDecimal tallyTon;

    @ApiModelProperty(value = "航陆运")
    private String shipLand;

    @ApiModelProperty(value = "航陆运")
    private String shipLandName;

    public String getShipLandName() {
        if (Func.isNull(shipLand)) {
            return "";
        }
        return DictBizCache.getValue("ship_land", shipLand);
    }

    @ApiModelProperty(value = "作业过程")
    private String operationType;

    @ApiModelProperty(value = "作业过程")
    private String operationTypeName;

    @ApiModelProperty(value = "作业活动")
    private String workActivity;

    @ApiModelProperty(value = "作业活动")
    private String workActivityName;

    /** 保管员 */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "保管员",notes = "")
    private Long keeper ;

    /** 保管员 */
    @ApiModelProperty(name = "保管员",notes = "")
    private String keeperName ;

    /** 苫盖 */
    @ApiModelProperty(name = "苫盖",notes = "")
    private String isCover ;

    /** 铺垫 */
    @ApiModelProperty(name = "铺垫",notes = "")
    private String isBedding ;

    /** 安全生产 */
    @ApiModelProperty(name = "安全生产",notes = "")
    private String isSafeProduction ;

    /** 影响货垛ID */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "影响货垛ID")
    private Long affectStorageId;

    /** 区域ID */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "区域ID",notes = "")
    private Long storageAreaId ;

    /** 区域 */
    @ApiModelProperty(name = "区域",notes = "")
    private String storageAreaName ;

    /** 货场 */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "货场",notes = "")
    private Long storagePositionId ;

    /** 货场 */
    @ApiModelProperty(name = "货场",notes = "")
    private String storagePositionName ;

    /** 货位 */
    @ApiModelProperty(name = "货位",notes = "")
    private String spot ;

    /** 备注 */
    @ApiModelProperty(name = "备注",notes = "")
    private String remark ;

    /** 一级配工ID */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "一级配工ID",notes = "")
    private Long arrangeId ;

    /** 配工信息 */
    @ApiModelProperty(name = "配工信息",notes = "")
    private String arrangeInfo ;

    /** 货位 */
    @ApiModelProperty(name = "舱口",notes = "")
    private String hold ;

    /** 货位 */
    @ApiModelProperty(name = "舱口",notes = "")
    private String holdName ;

    /** 公司 */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "公司",notes = "")
    private Long company ;

    /** 公司 */
    @ApiModelProperty(name = "公司",notes = "")
    private String companyName ;

    /** 队 */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "队",notes = "")
    private Long team ;

    /** 队 */
    @ApiModelProperty(name = "队",notes = "")
    private String teamName ;

    /** 组 */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "组",notes = "")
    private Long groups ;

    /** 组 */
    @ApiModelProperty(name = "组",notes = "")
    private String groupsName ;

    /** 队组全名 */
    @ApiModelProperty(name = "队组全名",notes = "")
    private String workerInfo ;

    /** 车数 */
    @ApiModelProperty(name = "车数",notes = "")
    private String cars ;

    /** 是否退关 */
    @ApiModelProperty(name = "是否退关",notes = "")
    private String isRetreat ;

    /** 机械IDs */
    @ApiModelProperty(name = "机械IDs",notes = "")
    private String machineIds ;

    /** 机械种类IDs */
    @ApiModelProperty(name = "机械种类IDs",notes = "")
    private String machineKinds ;

    /** 机械队组IDs */
    @ApiModelProperty(name = "机械队组IDs",notes = "")
    private String machineTeamIds ;

    /** 机械信息 */
    @ApiModelProperty(name = "机械信息",notes = "")
    private String machineInfo ;

    /** 出库时间 */
    @ApiModelProperty(name = "出库时间",notes = "")
    private String outTimeSpace ;

    @ApiModelProperty(value = "出库时间")
    private String outTimeSpaceName;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "goodsPositionId")
    private Long goodsPositionId;

    /** 区域code */
    @ApiModelProperty(name = "区域code",notes = "")
    private String areaCode ;

    /** 理货区域 */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "理货区域",notes = "")
    private Long areaId ;

    public String getOutTimeSpaceName() {
        if (Func.isNull(outTimeSpaceName)) {
            return "";
        }
        return DictBizCache.getValue(DictBizConstant.OUT_TIMES, outTimeSpace);
    }

    @ApiModelProperty(name = "是否检算",notes = "")
    private String isCheck ;

    @ApiModelProperty(name = "可编辑",notes = "")
    private String isEdit ;
}
